  let lng
  let lat
  function ditu(gotoAddress) {
    AMap.plugin('AMap.Geocoder', function () {
      var geocoder = new AMap.Geocoder({
        // city 指定进行编码查询的城市，支持传入城市名、adcode 和 citycode
      })
      geocoder.getLocation(gotoAddress, function (status, result) {
        if (status === 'complete' && result.info === 'OK') {
          // result中对应详细地理坐标信息
          // console.log(result);
          lng = result.geocodes[0].location.lng;
          lat = result.geocodes[0].location.lat;
          var map = new AMap.Map('container', {
            resizeEnable: true, 
            center: [lng, lat],
            zoom: 16
          });
          marker = new AMap.Marker({
            icon: "../images/jlzx-2.png",
            position: new AMap.LngLat(lng, lat),
            offset: new AMap.Pixel(-27, -25)
          });
          marker.setMap(map);
        }
      })
    })
  }

  function getIpInfo() {
    var path = 'https://myip.ipip.net/';
    if (path !== undefined) {
      var httpRequest = new XMLHttpRequest();//第一步：建立所需的对象
      httpRequest.open('GET', path + '?imageAve', true);//第二步：打开连接  将请求参数写在url中  ps:"./Ptest.php?name=test&nameone=testone"
      httpRequest.send();//第三步：发送请求  将请求参数写在URL中
      /**
       * 获取数据后的处理程序
       */
      httpRequest.onreadystatechange = function () {
        if (httpRequest.readyState == 4 && httpRequest.status == 200) {
          var info = httpRequest.responseText;//获取到json字符串，还需解析
          var ipresult = info.split("  ");
          const c2 = ipresult[1].split("：")[1].split(" ");
          document.getElementById("userAgentCity").innerHTML = c2[2];
        }
      };
    } else {
      console.log('获取信息失败');
    }
  }